package ace.module.product.api.model.input;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.PositiveOrZero;
import jakarta.validation.constraints.Size;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 添加商品基础资料.
 * @author Caspar
 *
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class PmsProductBaseSaveInput {

  @PositiveOrZero
  @Schema(title = "id", description = "修改必填")
  private Long id;

  @Builder.Default
  @NotNull
  @PositiveOrZero
  @Schema(title = "店铺id", description = "0=null")
  private Long shopId = 0L;

  @Builder.Default
  @NotNull
  @PositiveOrZero
  @Schema(title = "品牌id", description = "0=null")
  private Long brandId = 0L;

  @Builder.Default
  @NotNull
  @PositiveOrZero
  @Schema(title = "运费模板id", description = "0=null")
  private Long freightTemplateId = 0L;

  @Builder.Default
  @Size(max = 255)
  @Schema(title = "商品编号", description = "自动填充")
  private String sn = "";

  @Builder.Default
  @Size(max = 255)
  @Schema(title = "商品名称", description = "")
  private String name = "";

  @Builder.Default
  @Size(max = 255)
  @Schema(title = "搜索关键词", description = "")
  private String keywords = "";

  @Builder.Default
  @Max(value = 100)
  @PositiveOrZero
  @Schema(title = "搜索权重", description = "")
  private Long searchWeight = 0L;

  @Builder.Default
  @Schema(title = "审核状态", description = "1-草稿 2-审核中 99-审核失败 100-审核成功")
  private Integer auditStatus = 1;

  @Builder.Default
  @NotNull
  @Schema(title = "上架状态", description = "1-上架 2-下架")
  private Integer saleStatus = 2;


  @Builder.Default
  @NotNull
  @PositiveOrZero
  @Schema(title = "分类id", description = "0=null")
  private Long categoryId = 0L;

  @Size(max = 1000)
  @Schema(title = "主图")
  private String mainImgUrl;

  @Size(max = 1000)
  @Schema(title = "主视频")
  private String mainVideoUrl;

  @Size(max = 10)
  @Schema(title = "图册")
  private List<String> galleries;


  @Schema(title = "商品详情")
  private List<PmsProductDetailSaveInput> details;
}
